wireguard: add checkbox for `nohostroute` option
authorYuxiang Zhu <[email protected]>
Sat, 8 Feb 2020 18:05:50 +0000 (02:05 +0800)
committerYuxiang Zhu <[email protected]>
Sat, 8 Feb 2020 18:12:30 +0000 (02:12 +0800)
This change allows to configure `nohostroute` option for wireguard to explicitely prevent creation
of host routes to endpoints.

By default without `option nohostroute '1'`, an explicite route to the peer's endpoint will be created in the main routing table with the next hop to the gateway. However, it causes issues with some setup. Enabling this option will inhibit this behavior. See discussions at http://lists.openwrt.org/pipermail/openwrt-devel/2019-March/016329.html.

Signed-off-by: Yuxiang Zhu <[email protected]>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index c9b00abdece4334a379d19dd7d9181b5b2212fab..c8e1f8403e3d283e40a86443b32e958b6045e504 100644 (file)
@@ -60,6 +60,8 @@ return network.registerProtocol('wireguard', {
                o.datatype = 'ipaddr';
                o.optional = true;
 
+               o = s.taboption('general', form.Flag, 'nohostroute', _('No Host Routes'), _('Optional. Do not create host routes to peers.'));
+               o.optional = true;
 
                // -- advanced --------------------------------------------------------------------